-
Notifications
You must be signed in to change notification settings - Fork 57
Add new building blocks. #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Needs a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor things I'd like to be discussed or fixed - otherwise great work! I love working with other Python devs :)
.gitignore
Outdated
private.key | ||
*.key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no big deal, but *.key and private.key overlap :)
) | ||
|
||
response = client.update_call(UUID, action="earmuff") | ||
pprint(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of pprint!
voice/record-a-call.py
Outdated
def recordings(): | ||
data = request.get_json() | ||
pprint(data) | ||
return ("200") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this is confusing, for a few reasons:
- The parentheses aren't needed, and imply a tuple (which it isn't because it would need a trailing comma)
- The string
"200"
will be converted to the body of the response, but it looks like the HTTP status code. - The HTTP 200 status code is implicit :)
I'm not sure what content would actually be useful, given that it's ignored by Nexmo's servers, but something more informative like the following may be more clear:
return "Webhook received"
voice/record-a-conversation.py
Outdated
def recordings(): | ||
data = request.get_json() | ||
pprint(data) | ||
return ("200") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
|
||
NOW = datetime.utcnow() | ||
DATE_END = NOW.replace(microsecond=0).isoformat()+"Z" | ||
DATE_START = (NOW - timedelta(hours=24, minutes=00)).replace(microsecond=0).isoformat()+"Z" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
voice/retrieve-info-for-all-calls.py
Outdated
DATE_START = (NOW - timedelta(hours=24, minutes=00)).replace(microsecond=0).isoformat()+"Z" | ||
|
||
params = {"date_start": DATE_START, "date_end": DATE_END} | ||
response = client.get_calls(params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines could just be:
response = client.get_calls(date_start=DATE_START, date_end=DATE_END)
... which would be more consistent with the calling conventions above - but ultimately I'm not bothered too much.
This should be the code for the 'connect an inbound call' building block. Hopefully it's the format you require.